#!/usr/bin/env bash
# curl_chrome146_hdrfree — Chrome 146 TLS/H2 fingerprint via curl-impersonate's --impersonate
# preset, plus --compressed to actually decode gzip/br/zstd responses. -H overrides REPLACE the
# baked default (verified against curl-impersonate).
#
# ★★★★★ 2026-09-06 — WHY. Engine has been on curl_chrome131_hdrfree since chrome131 was current;
# Chrome stable is now 153. CDN serves the same parseable stub for chrome146 as chrome131 from
# flameproxies exits (measured 4/4 A/B), so the fingerprint upgrade is purely a wrapper change.
#
# 🛑 --compressed MATTERS. Without it the wrapper returns raw br-encoded bytes and every parser
#    that reads the response as text sees binary garbage — measured: `curl_chrome146` (which DOES
#    have --compressed baked into its own wrapper) returns 713b parseable JS while the same
#    request without --compressed returns 711b of binary. This is the bug the first draft of this
#    wrapper had.
#
# 🛑 lib/impersonate.js flags for variant '146' MUST STAY IN LOCK-STEP with this. Its case '146':
#    returns ['--compressed', '--impersonate', 'chrome146'] — the exact two flags below, verified.
#    That path handles win32 where wrappers cannot execute; this handles macOS.
#
# 🛑 The engine's TLS_VER regex reads /chrome(\d+)/ from TARGET_CURL_BIN. This file's name
#    yields 146, so User-Agent / sec-ch-ua construction updates in lockstep. Do NOT rename.

dir=${0%/*}
exec "$dir/curl-impersonate" --compressed --impersonate chrome146 "$@"
